<?php 
?>


<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>员工管理系统-2019404145</title>
		<script type="text/javascript" src="js/jquery-3.5.1.js"></script>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
		<script type="text/javascript" src="js/bootstrap.js"></script>
		<link rel="stylesheet" type="text/css" href="css/workers.css"/>
	</head>
	<body>
		<div class="top">
			<h1 align="center" style="line-height: 85px;">快乐公司-员工表</h1>
		</div>
		<form action="" method="get" style="margin-top: 50px; width: 20%; margin-left: 10%;">				
				<div class="input-group">
				      <input type="text" class="form-control" name="search" placeholder="输入搜索关键字" 
				      	value="<?php echo isset($_GET['search'])?$_GET['search']:""; ?>">
				      <span class="input-group-btn">				        
						<input class="btn btn-default" type="submit" value="搜索">
				      </span>
				 </div>
				
			</form>
		<div class="container">
			
			<table class="table table-bordered table-hover">
				<thead>
					<tr class="tr">
						<td>ID</td>
						<td>头像</td>
						<td>姓名</td>
						<td>个性留言</td>
						<td>所属部门</td>
						<td>入职时间</td>
						<td>操作</td>
					</tr>
				</thead>
				<?php
//					一个循环，bbs是查询后的二维数组，rows是第几次循环的次数
					foreach($bbs as $rows){
							echo "<tr>";
							echo "<td>";echo $rows['id'];echo "</td>";
							echo "<td>";echo "<img src='".$rows['头像']."'/>";echo "</td>";
							echo "<td class='Sname'>";echo $rows['姓名'];echo "</td>";
							echo "<td>";echo $rows['个性留言'];echo "</td>";
							echo "<td>";echo $rows['所属部门'];echo "</td>";
							echo "<td>";echo $rows['入职时间'];echo "</td>";
							echo "<td>";?>
								<a href="javascript: " onclick=" location.href='update.php?id=<?php echo $rows['id']?>&text=<?php echo $rows['个性留言']?>&name=<?php echo $rows['姓名']?>'">修改</a>
								<br />
								<br />
								<a href="javascript: " onclick="if(confirm('确定删除么')) location.href='del.php?id=<?php echo $rows['id']?>'">删除</a>
							<?php
						echo "</tr>";
					}	
				?>
			</table>
			<nav aria-label="Page navigation">
			  <ul class="pagination">
			  	<?php 
			   for($i=1;$i<=$ht;$i++){
			   	echo "<li><a href='main.php?page={$i}&search={$sch}'>".$i."</li></a>";
			   }
			   ?>
			  </ul>
			</nav>
			
			<?php
				echo "一共有".$hang."位员工";
				?>
		</div>
		<div class="insertWorker" style="height: 695px;">
			<p class="welcom" align="center">留下你的脚步吧</p>
			<form action="addWorker.php" method="post">
				<p class="u-name">
					<sapn class="f-t">昵称：</sapn><input type="text" name="name" class="name" placeholder="你的名字？">
					<br/><br/>
					<span class="f-t">你是哪个部门？</span><br>
					<input type="radio" name="sex" value="快乐部" checked="checked" />快乐部
					<input type="radio" name="sex" value="法务部" />法务部
					<input type="radio" name="sex" value="市场部" />市场部
					<br />
					<input type="radio" name="sex" value="媒体部" />媒体部
					<input type="radio" name="sex" value="销售部" />销售部
					<input type="radio" name="sex" value="公关部" />公关部
				</p>
				<span class="f-t">你的入职时间是？</span>
				<p><input type="date" name="msc"></p>
				
				<p class="f-t">个性留言</p>
				<input type="text" name="text" id="text" placeholder="留下的你话语吧" />
					<p class="f-t">选择你心仪的头像吧	~</p>
				<p class="tow">
					<input type="radio" name="imgurl" value="img/1.jpg" checked="checked" /><img src=" img/1.jpg" alt="" />
					<input type="radio" name="imgurl" value="img/2.jpg" /><img src=" img/2.jpg" alt="" />
					<br />
					<input type="radio" name="imgurl" value="img/3.jpg" /><img src=" img/3.jpg" alt="" />
					<input type="radio" name="imgurl" value="img/4.jpg" /><img src=" img/4.jpg" alt="" />
					<br />
					<input type="radio" name="imgurl" value="img/5.jpg" /><img src=" img/5.jpg" alt="" />
					<input type="radio" name="imgurl" value="img/6.jpg" /><img src=" img/6.jpg" alt="" />
				</p>
				<p class="thr" align="center"><input class="btn" type="submit" value="提交" /></p>
			</form>
		</div>
	</body>
</html>
